package com.mspbots.core.ticketai;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mspbots.core.AbstractBaseController;
import com.mspbots.core.ticketai.model.ProjectPhase;
import com.mspbots.core.ticketai.service.ProjectPhaseService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

@RestController
@RequiredArgsConstructor
@RequestMapping("tenant/project/phase")
public class ProjectPhaseController extends AbstractBaseController<ProjectPhase, ProjectPhaseService> {

    @Override
    @GetMapping(path = "/list")
    public Callable selectList(ProjectPhase queryParams) {
        QueryWrapper<ProjectPhase> queryWrapper = new QueryWrapper<>(queryParams);
        queryWrapper.select("cw_id", "name");
        return () -> service.list(queryWrapper);
    }
}
